/*
 * @Descripttion:
 * @version:
 * @Author:
 * @Date: 2021-09-13 16:42:35
 * @LastEditors: xiaochengang
 * @LastEditTime: 2021-09-13 17:03:46
 */

export function currying (fn) {
    const func = function (...args) {
        if (args.length >= fn.length) {
            return fn(...args)
        }
        else {
            return (...left) => {
                return func(...args, ...left)
            }
        }
    }
    return func
}